{% extends 'oscar/dashboard/layout.html' %}
{% load i18n %}

{% block breadcrumbs %}
    <ul class="breadcrumb">
        <li>
            <a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a>
        </li>
        <li class="active">{% trans "Product Type" %}</li>
    </ul>
{% endblock %}

{% block header %}
    <div class="page-header">
        <a href="{% url 'dashboard:catalogue-class-create' %}" class="btn btn-primary btn-lg pull-right"><i class="icon-plus"></i> {% trans "Create new product type" %}</a>
        <h1>{% trans "Product types" %}</h1>
    </div>
{% endblock header %}

{% block dashboard_content %}
    {% if classes %}
        <table class="table table-striped table-bordered table-hover">
            <caption><i class="icon-sitemap icon-large"></i>{% trans 'Product Types' %}</caption>
            <thead>
                <tr>
                    <th>{% trans "Name" %}</th>
                    <th>{% trans "Requires shipping" %}</th>
                    <th>{% trans "Track stock?" %}</th>
                    <th>&nbsp;</th>
                </tr>
            </thead>
            <tbody>
                {% for class in classes %}
                    <tr>
                        <td><a href="{% url 'dashboard:catalogue-class-update' class.id %}">{{ class.name }}</a></td>
                        <td><a href="{% url 'dashboard:catalogue-class-update' class.id %}">{{ class.requires_shipping|yesno }}</a></td>
                        <td><a href="{% url 'dashboard:catalogue-class-update' class.id %}">{{ class.track_stock|yesno }}</a></td>
                        <td>
                            <div class="btn-toolbar">
                                <div class="btn-group">
                                    <button class="btn btn-default dropdown-toggle" type="submit" data-toggle="dropdown" aria-expanded="true">
                                        {% trans "Actions" %}
                                        <span class="caret"></span>
                                    </button>
                                    <ul class="nav dropdown-menu pull-right">
                                        <li><a href="{% url 'dashboard:catalogue-class-update' pk=class.id %}">{% trans "Edit product type" %}</a></li>
                                        <li><a href="{% url 'dashboard:catalogue-class-delete' pk=class.id %}">{% trans "Delete" %}</a></li>
                                    </ul>
                                </div>
                            </div>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    {% else %}
        <p>{% trans "There are no product types." %}</p>
    {% endif %}
{% endblock dashboard_content %}
